%folder: str
%   the folder storage simualated data
%seedID: str
%   the seed number of phantom
%emitter: a single number
%   the idx of the emitter(source of signal).

function p = read_waveform_data(folder, seedID, emitter)  
    validateattributes(emitter,{'numeric'},{'>=',0,'<=',1023});
    %validatestring(folder,{' '});
    idx = num2str(ceil(emitter/128));
    p_name = fullfile(folder, [seedID,'_',idx,'.hdf5']);
    if ~exist(p_name,'file') 
        error([p_name,' dose not exist']); 
    end
    p = h5read(p_name,['/',num2str(emitter)]);
end